package com.snoob.bffAuth.service.impl;

import com.snoob.bffAuth.service.EnterpriseUserService;
import com.snoob.bffAuth.wConfig.properties.SysProperties;
import com.snoob.bffAuth.wConfig.redis.RedissonSingleService;
import com.snoob.springcloudalibaba.base.BaseException;
import com.snoob.springcloudalibaba.enums.SysKeyEnum;
import com.snoob.springcloudalibaba.pipleline.dto.UserLoginDtoReq;
import com.snoob.springcloudalibaba.pipleline.dto.UserLoginDtoRes;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @描述：企业用户接口实现类
 * @作者：lixing_java@163.com
 * @时间：2022/8/6 21:32
 */
@Service("bffEnterpriseUserServiceImpl")
public class EnterpriseUserServiceImpl implements EnterpriseUserService {
    @Resource
    private SysProperties sysProperties;

    @Resource
    private RedissonSingleService<String> redissonSingleServiceStr;

//    @Resource
//    private EnterpriseUserController enterpriseUserFeign;

    /**
     * @描述 企业用户登陆
     */
    @Override
    public UserLoginDtoRes enterpriseUserLogin(UserLoginDtoReq dto) {
        // 登陆方式：1、账号和密码登录方式登陆 2、短信验证码登录
        String loginType = dto.getLoginType();
        if (SysKeyEnum.LOGIN_TYPE_COMMON.getKey().equals(loginType)) {
            return null;
        } else if (SysKeyEnum.LOGIN_TYPE_SMS.getKey().equals(loginType)) {
            // 校验短信验证码
            //checkSmsCode(dto);
            return null;
        } else {
            throw new BaseException("登陆方式非法");
        }
    }
}
